<template>
  <div class="button">
  <a-button @click="countDown">
    提交
  </a-button>
  </div>
</template>
<script>
export default {
  methods: {
    countDown() {
      let secondsToGo = 5;
      const modal = this.$success({
        title: '教育信息提交成功！',
        content: `本窗口将会在 ${secondsToGo}秒后自动关闭`,
      });
      const interval = setInterval(() => {
        secondsToGo -= 1;
        modal.update({
          content: `本窗口将会在 ${secondsToGo}秒后自动关闭`,
        });
      }, 1000);
      setTimeout(() => {
        clearInterval(interval);
        modal.destroy();
      }, secondsToGo * 1000);
    },
  },
};
</script>
<style>
.button{
  position: relative;
  left: 50px;
  float: left;
}
</style>